<?php
declare (strict_types = 1);

namespace app\validate\common\user;

use app\model\communal\UserModel;
use think\Validate;

class WechatOpenValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id' => ['require', 'number', 'gt:0'],
        'code' => ['require'],

        'page' => ['number', 'gt:0'],
        'page_size' => ['number', 'gt:0'],
    ];

    protected $field = [
        'code' => '授权码',

        'page' => '当前页数',
        'page_size' => '每页条数',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
    ];

    /**
     * 场景
     * @var array
     */
    protected $scene = [
        'code' => ['code'],
    ];
}
